package cn.wolfcode.luowowo.website.web.controller;

import cn.wolfcode.luowowo.common.result.Result;
import cn.wolfcode.luowowo.member.domain.UserInfo;
import cn.wolfcode.luowowo.member.service.ICollectsService;
import cn.wolfcode.luowowo.website.web.annotation.RequireLogin;
import cn.wolfcode.luowowo.website.web.annotation.UserParam;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("")
public class CollectsController {

    @Reference
    private ICollectsService collectsService;

    //我的收藏
    @RequestMapping("/mine/travelcollection")
    @RequireLogin//贴上这个需要登录后才能进入
    public String travelcollection(@UserParam UserInfo userInfo,Model model){
        model.addAttribute("userInfo",userInfo);

        return "mine/travelcollection";
    }


    @RequestMapping(value = "/collects/getCollects",method = RequestMethod.POST)
    @ResponseBody
    public Result selectCollectsByParam(@RequestBody JSONObject json){
        return collectsService.selectCollectsByParam(json);
    }
}
